package com.jackstraw.jack_base.datasource.moredatasource.config;

import com.jackstraw.jack_base.datasource.database.parten.config.DataBaseConfiguration;
import com.jackstraw.jack_base.datasource.database.parten.entity.bean.DataBaseTemplateCut;
import com.jackstraw.jack_base.datasource.moredatasource.bean.C3p0DataBaseEntity;
import com.jackstraw.jack_base.datasource.moredatasource.bean.C3p0DataBaseFactory;
import com.jackstraw.jack_base.datasource.moredatasource.bean.C3p0DataBaseProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.EnableTransactionManagement;


@Slf4j
@Configuration
@EnableTransactionManagement
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
public class C3p0DataBaseConfiguration
        extends DataBaseConfiguration<C3p0DataBaseEntity, C3p0DataBaseFactory, C3p0DataBaseProperties, C3p0DataBaseConfiguration> {


    public C3p0DataBaseConfiguration(ApplicationContext applicationContext, Environment environment) {
        super(applicationContext, environment);
    }

    @Override
    public C3p0DataBaseProperties properties() {
        return new C3p0DataBaseProperties();
    }

    @Override
    public C3p0DataBaseFactory dataSourceBuildFactory() {
        return new C3p0DataBaseFactory();
    }

}